package com.liujun.spring4.demo.aop.iocset.xmlset.collection;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.util.List;
import java.util.Map;

/**
 * 进行工厂方法测试
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-16 17:33:00
 */
public class BeanUtilsCollection {

  private ApplicationContext context;

  @BeforeClass
  private void start() {
    context =
        new ClassPathXmlApplicationContext(
                "com/liujun/spring4/demo/aop/iocset/xmlset/collection/beanCollectionUtils.xml");
  }

  @Test
  public void utilList() {
    List list = (List) context.getBean("utilList");
    System.out.println(list);
    Assert.assertNotNull(list);
  }

  @Test
  public void utilMap() {
    Map map = (Map) context.getBean("utilMap");
    System.out.println(map);
    Assert.assertNotNull(map);
  }

  @Test
  public void utilCon() {
    int maxValue = (Integer) context.getBean("MAXValue");
    System.out.println(maxValue);
    Assert.assertNotNull(maxValue);
  }
}
